#ifndef SLIDEDOWN_H_
#define SLIDEDOWN_H_

#include "Effect.h"

namespace JDL
{
  class SlideDown : public Effect
  {
  public:
    SlideDown(Drawable *obj, int speed, bool repeat = false);
    virtual ~SlideDown();
    virtual void	Do(Drawable *obj)
    {
      if (_zone.h < _size.h)
	_zone.h += _speed;
      else if (_zone.h == _size.h && _repeat == true)
	_zone.h = 0;
      obj->SetSubRect(_zone.x, _zone.y, _zone.w, _zone.h);
    }
    private:
    SDL_Rect	_size;
    SDL_Rect	_zone;
    int		_speed;
  };
}

#endif
